package com.system.po;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.sql.Timestamp;
import java.util.*;

public class Plan {

    private Integer id;//planId
    private String text;//title
    private Integer state;//展开
    private boolean checked;//是否被选中
    private String iconCls;//图标
    private String content;
    private Integer type;
    private Integer accidentId;
    private Integer placeNumber;
    private String placeName;
    private Integer parentId;
    private String parentName;
    private Map<String,Object> attributes=new HashMap<>();

    private String path;
    private String url;

    private Date createTime;

    private Date updateTime;


    //树的子级
    @ApiModelProperty(hidden = true)
    private List<Plan> children = new ArrayList<>();


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    public String getIconCls() {
        return iconCls;
    }

    public void setIconCls(String iconCls) {
        this.iconCls = iconCls;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getAccidentId() {
        return accidentId;
    }

    public void setAccidentId(Integer accidentId) {
        this.accidentId = accidentId;
    }

    public Integer getPlaceNumber() {
        return placeNumber;
    }

    public void setPlaceNumber(Integer placeNumber) {
        this.placeNumber = placeNumber;
    }

    public String getPlaceName() {
        return placeName;
    }

    public void setPlaceName(String placeName) {
        this.placeName = placeName;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public Map<String, Object> getAttributes() {
        this.attributes.put("url","/plan/editPlan/"+this.getId());
        this.attributes.put("path","/plan/editPlan/"+this.getId());
        return attributes;
    }

    public void setAttributes(Map<String, Object> attributes) {
        this.attributes = attributes;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public List<Plan> getChildren() {
        return children;
    }

    public void setChildren(List<Plan> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "Plan{" +
                "id=" + id +
                ", text='" + text + '\'' +
                ", state=" + state +
                ", checked=" + checked +
                ", iconCls='" + iconCls + '\'' +
                ", content='" + content + '\'' +
                ", type=" + type +
                ", accidentId='" + accidentId + '\'' +
                ", placeNumber=" + placeNumber +
                ", placeName='" + placeName + '\'' +
                ", parentId=" + parentId +
                ", parentName='" + parentName + '\'' +
                ", attributes=" + attributes +
                ", path='" + path + '\'' +
                ", url='" + url + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", children=" + children +
                '}';
    }
}
